@echo off
cls
echo Installing Visual Studio templates...
echo.

set templateinst=..\Visual Studio Templates

:: Create folder?
if not exist "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC\1033" mkdir "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC\1033">nul

:: Copy templates
copy /y "%templateinst%\*.zip" "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC\1033\*.zip">nul

:: Register templates
"%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /setup
"%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /installvstemplates
goto installed

:: Done!
:installed
echo Installation complete.
echo.
echo.
pause